<template>
  <div class="detail">
    <h3>{{ detail.title }}</h3>
    <p v-html="detail.content"></p>
    <div class="imgList" v-for="(item, index) in imgList" :key="index" v-show="detail.picUrl">
      <img :src="item.url" mode="aspectFill">
      <p>{{ item.pic_title }}</p>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      detail: {},
      imgList: []
    }
  },
  activated () {
    this.detail = JSON.parse(localStorage.getItem('historyDetail'))
    this.detail.content = this.detail.content.replace(/\n/g, '<br>')
    if (this.detail.picUrl) {
      this.imgList = JSON.parse(this.detail.picUrl)
    }
  },
  methods: {

  }
}
</script>
<style lang="scss" scoped>
.detail {
  padding: 0 10px;
  h3 {
    text-align: left;
    margin: 10px 0;
    font-size: 18px;
    font-weight: bold;
  }
  p {
    text-align: justify;
    font-size: 16px;
    line-height: 25px;
  }
  .imgList {
    margin: 10px 0;
    line-height: 0;
    img {
      width: 100%;
    }
    p {
      text-align: center;
      font-size: 16px;
      margin: 10px 0;
    }
  }
}
</style>
